<template>
  <u-form labelWidth="auto" disabled>
    <view>
      <view style="display: flex">
        <view>
          <view class="option" style="width: 520rpx">
            <view class="lf">业务分类</view>
            <view class="rl">{{ item.categoryName }}</view>
          </view>

          <view class="option" style="width: 520rpx">
            <view class="lf">合同占比(%)</view>
            <view class="rl">{{ item.contractRate }}</view>
          </view>

          <view class="option" style="width: 520rpx">
            <view class="lf">合同分配额(元)</view>
            <view class="rl">{{ item.contractAmount }}</view>
          </view>
          <view class="option" style="width: 520rpx">
            <view class="lf">切割合同额(元)</view>
            <view class="rl">{{ item.cutContractAmount }}</view>
          </view>
          <view class="option" style="width: 520rpx">
            <view class="lf">生产团队</view>
            <view class="rl">{{ item.productTeam_dictText }}</view>
          </view>
          <!-- <view class="option" style="width: 520rpx">
            <view class="lf">生产公司</view>
            <view class="rl">{{ item.productCompanyId }}</view>
          </view> -->
        </view>

        <view style="flex: 1; display: flex; align-items: center; justify-content: flex-end" v-if="!disabled">
          <u-icon name="edit-pen-fill" color="#2979ff" size="20" @click="handleEidtForm(item, index)"></u-icon>
          <!-- <u-button size="small" type="primary">完善</u-button> -->
          <u-line direction="col" length="20" margin="0 10rpx"></u-line>
          <u-icon name="trash-fill" color="red" size="20" @click="handleRemoveForm(item)"></u-icon>
        </view>
      </view>
    </view>
  </u-form>
</template>

<script>
import { filterMultiDictText, initDictOptions } from '@/utils/JDictSelectUtil.js'

export default {
  name: 'PriceFormInfo',
  components: {},
  props: {
    index: {
      type: Number,
      default: null,
    },
    item: {
      type: Object,
      default: () => ({}),
    },
    progressVoList: {
      type: Array,
      default: () => [],
    },
    disabled: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      filterMultiDictText,
      initDictOptions,
      dictOptions: {},
      smallList: [],
    }
  },
  watch: {
    item: {
      handler(val) {},
      immediate: true,
      deep: true,
    },
  },
  methods: {
    handleCopyForm(item) {
      this.$emit('copy', [item, this.index])
    },
    handleEidtForm(item) {
      this.$emit('edit', [item, this.index])
    },
    handleRemoveForm(item) {
      uni.showModal({
        content: '确定删除吗？',
        success: (res) => {
          if (res.confirm) {
            this.$emit('remove', item)
          }
        },
      })
    },
  },
}
</script>

<style scoped lang="scss">
.inforamtion {
  margin-top: 10rpx;
  padding: 10rpx;
  border-radius: 15rpx;
  box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.1);
}
</style>
